package com.org.redis.pubandsub;

import com.org.redis.config.JedisUtils;
import redis.clients.jedis.Jedis;

public class MsgConsumer {

    public static void main(String[] args) {

        Jedis jedis = JedisUtils.getJedis();

        try {
            jedis.subscribe(new MyJedisPubSub(),"redis-pubsub");
        }catch (Exception e){
            e.printStackTrace();
        }finally {
            JedisUtils.returnResource(jedis);
        }

    }
}
